/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package horsechess.util;

import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Graphics2D;
import javax.swing.JFrame;

/**
 *
 * @author Administrator
 */
public class ClockLabel extends JFrame {

     private static Font sanSerifFont = new java.awt.Font("Comic Sans MS", 1, 18);

     private static Graphics2D g2d;
     public ClockLabel(){

     }
    @Override
    public void paintComponents(Graphics g) {
        g2d=(Graphics2D) g;
    }

    public void drawString(String msg)
    {
        FontMetrics fm = g2d.getFontMetrics();
         int w = fm.stringWidth(msg);
        int h = fm.getAscent();
        g2d.drawString("Java Source", 120 - (w / 2), 120 + (h / 4));
    }
    public static void main(String[] args) {
        ClockLabel cl=new ClockLabel();
        cl.paintAll(cl.getGraphics());
        cl.drawString("Game over");

    }
}
